home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 5
/
Amiga Plus Sonderheft 1996 #5.iso
/
programme
/
imagedesk304
/
imagedesk
/
instdata.lha
/
instdata
/
rexx
/
ScanSubDirs.IDesk
< prev
next >
Wrap
Text File
|
1995-07-10
|
2KB
|
78 lines
/* von Dirk Federlein */
OPTIONS RESULTS
if( ADDRESS() ~= "IDESK_REXXPORT" ) then
ADDRESS IDESK_REXXPORT
/* PARSE ARG ROOT */
IDGETPATH '"Pfad für die Kataloge : "'
CATPATH = result
if (RIGHT(CATPATH,1) ~== ':') & (RIGHT(CATPATH,1) ~== '/')
then CATPATH = CATPATH||'/'
IDGETPATH '"Zu durchsuchender Pfad : "'
ROOT = result
CALL PARSEFILENAME(ROOT, 'FILE')
rootfilename = result
if (RIGHT(ROOT,1) ~== ':') & (RIGHT(ROOT,1) ~== '/')
then ROOT = ROOT||'/'
if ~show('L', "rexxsupport.library")
then do
if ~addlib('sys:libs/rexxsupport.library', 0, -30)
then
say "Added rexxsupport.library"
else do
say "Rexxsupport.library not available, exiting..."
exit 10
end
end
ADDRESS COMMAND 'MAKEDIR 'CATPATH||rootfilename
GENCAT CATPATH||rootfilename||'.cat' ROOT
CATPATH = CATPATH||rootfilename
if (RIGHT(CATPATH,1) ~== ':') & (RIGHT(CATPATH,1) ~== '/')
then CATPATH = CATPATH||'/'
CALL SCANDIR(ROOT,CATPATH)
EXIT
SCANDIR: PROCEDURE
PARSE ARG AKTDIR, CATPATH
DIRFILES = ShowDir(AKTDIR,DIR)
DO I = 1 TO WORDS(DIRFILES)
GENCAT CATPATH||WORD(DIRFILES,I)||'.cat' '"'||AKTDIR||WORD(DIRFILES,I)||'"'
DUMMY = SCANDIR(AKTDIR||WORD(DIRFILES,I)||'/',CATPATH)
END
RETURN 0
/* Split filename from path */
ParseFileName: procedure
/* Arguments: **
** FilePath := Any valid AmigaDOS file specification **
** Part := [Optional] 'F', 'FILE', or omit to get filename **
** Anything else to retrieve the path */
parse arg FilePath, Part
DivPos = max(lastpos(':', FilePath),lastpos('/', FilePath)) +1
if abbrev('FILE', upper(Part))
then return substr(FilePath, DivPos)
else
return strip(left(FilePath, DivPos-1),'T', '/')